<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>JSON Voorhees: jsonv/serialization.hpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://www.mathjax.org/mathjax/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">JSON Voorhees
   </div>
   <div id="projectbrief">Killer JSON for C++</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('serialization_8hpp.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">serialization.hpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Conversion between C++ types and JSON values.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;<a class="el" href="config_8hpp_source.html">jsonv/config.hpp</a>&gt;</code><br />
<code>#include &lt;<a class="el" href="nested__exception_8hpp_source.html">jsonv/detail/nested_exception.hpp</a>&gt;</code><br />
<code>#include &lt;<a class="el" href="scope__exit_8hpp_source.html">jsonv/detail/scope_exit.hpp</a>&gt;</code><br />
<code>#include &lt;<a class="el" href="path_8hpp_source.html">jsonv/path.hpp</a>&gt;</code><br />
<code>#include &lt;<a class="el" href="value_8hpp_source.html">jsonv/value.hpp</a>&gt;</code><br />
<code>#include &lt;memory&gt;</code><br />
<code>#include &lt;new&gt;</code><br />
<code>#include &lt;typeinfo&gt;</code><br />
<code>#include &lt;typeindex&gt;</code><br />
<code>#include &lt;type_traits&gt;</code><br />
<code>#include &lt;utility&gt;</code><br />
<code>#include &lt;vector&gt;</code><br />
</div>
<p><a href="serialization_8hpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structjsonv_1_1version.html">jsonv::version</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents a version used to extract and encode JSON objects from C++ classes.  <a href="structjsonv_1_1version.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1duplicate__type__error.html">jsonv::duplicate_type_error</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exception thrown if an insertion of an extractor or serializer into a formats is attempted, but there is already an extractor or serializer for that type.  <a href="classjsonv_1_1duplicate__type__error.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1extraction__error.html">jsonv::extraction_error</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exception thrown if there is any problem running <code>extract</code>.  <a href="classjsonv_1_1extraction__error.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1no__extractor.html">jsonv::no_extractor</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Thrown when <code><a class="el" href="classjsonv_1_1formats.html#a4f5ccf3fbaf50aee040a6dbaa3859447" title="Extract the provided type from a value into an area of memory. ">formats::extract</a></code> does not have an <code>extractor</code> for the provided type.  <a href="classjsonv_1_1no__extractor.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1no__serializer.html">jsonv::no_serializer</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Thrown when <code><a class="el" href="classjsonv_1_1formats.html#afd80a13509c2d95d3ea2053e57a85d8a" title="Encode the provided value from into a JSON value. ">formats::to_json</a></code> does not have a <code>serializer</code> for the provided type.  <a href="classjsonv_1_1no__serializer.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1extractor.html">jsonv::extractor</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">An <code>extractor</code> holds the method for converting a <code>value</code> into an arbitrary C++ type.  <a href="classjsonv_1_1extractor.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1serializer.html">jsonv::serializer</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A <code>serializer</code> holds the method for converting an arbitrary C++ type into a <code>value</code>.  <a href="classjsonv_1_1serializer.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1adapter.html">jsonv::adapter</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">An <code>adapter</code> is both an <code>extractor</code> and a <code>serializer</code>.  <a href="classjsonv_1_1adapter.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html">jsonv::formats</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Simply put, this class is a collection of <code>extractor</code> and <code>serializer</code> instances.  <a href="classjsonv_1_1formats.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1context__base.html">jsonv::context_base</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides extra information to routines used for extraction.  <a href="classjsonv_1_1context__base.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1extraction__context.html">jsonv::extraction_context</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1serialization__context.html">jsonv::serialization_context</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga645b8b2ddf86926dab927adb704ea352"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Serialization.html#ga645b8b2ddf86926dab927adb704ea352">jsonv::duplicate_type_action</a> : unsigned char { <a class="el" href="group__Serialization.html#gga645b8b2ddf86926dab927adb704ea352a567bc1d268f135496de3d5b946b691f3">jsonv::duplicate_type_action::ignore</a>, 
<a class="el" href="group__Serialization.html#gga645b8b2ddf86926dab927adb704ea352a9dde360102c103867bd2f45872f1129c">jsonv::duplicate_type_action::replace</a>, 
<a class="el" href="group__Serialization.html#gga645b8b2ddf86926dab927adb704ea352a42552b1f133f9f8eb406d4f306ea9fd1">jsonv::duplicate_type_action::exception</a>
 }<tr class="memdesc:ga645b8b2ddf86926dab927adb704ea352"><td class="mdescLeft">&#160;</td><td class="mdescRight">The action to take when an insertion of an extractor or serializer into a formats is attempted, but there is alredy an extractor or serializer for that type.  <a href="group__Serialization.html#ga645b8b2ddf86926dab927adb704ea352">More...</a><br /></td></tr>
</td></tr>
<tr class="separator:ga645b8b2ddf86926dab927adb704ea352"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga75b53c85ab73bce4a1d0027c556715a8"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ga75b53c85ab73bce4a1d0027c556715a8"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__Serialization.html#ga75b53c85ab73bce4a1d0027c556715a8">jsonv::extract</a> (const value &amp;from, const formats &amp;fmts)</td></tr>
<tr class="memdesc:ga75b53c85ab73bce4a1d0027c556715a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extract a C++ value from <em>from</em> using the provided <em>fmts</em>.  <a href="group__Serialization.html#ga75b53c85ab73bce4a1d0027c556715a8">More...</a><br /></td></tr>
<tr class="separator:ga75b53c85ab73bce4a1d0027c556715a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac24f0cb864988715300f4741b5031546"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:gac24f0cb864988715300f4741b5031546"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__Serialization.html#gac24f0cb864988715300f4741b5031546">jsonv::extract</a> (const value &amp;from)</td></tr>
<tr class="memdesc:gac24f0cb864988715300f4741b5031546"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extract a C++ value from <em>from</em> using <code><a class="el" href="classjsonv_1_1formats.html#a4403758d5e87d0862a04fc5d9171991d" title="Get the global formats instance. ">jsonv::formats::global()</a></code>.  <a href="group__Serialization.html#gac24f0cb864988715300f4741b5031546">More...</a><br /></td></tr>
<tr class="separator:gac24f0cb864988715300f4741b5031546"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaabee8db6887a255c3b351d127bfad140"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:gaabee8db6887a255c3b351d127bfad140"><td class="memTemplItemLeft" align="right" valign="top">value&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__Serialization.html#gaabee8db6887a255c3b351d127bfad140">jsonv::to_json</a> (const T &amp;from, const formats &amp;fmts)</td></tr>
<tr class="memdesc:gaabee8db6887a255c3b351d127bfad140"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode a JSON <code>value</code> from <em>from</em> using the provided <em>fmts</em>.  <a href="group__Serialization.html#gaabee8db6887a255c3b351d127bfad140">More...</a><br /></td></tr>
<tr class="separator:gaabee8db6887a255c3b351d127bfad140"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga52201f62c91cdfb758fdb62a330f6e5f"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:ga52201f62c91cdfb758fdb62a330f6e5f"><td class="memTemplItemLeft" align="right" valign="top">value&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__Serialization.html#ga52201f62c91cdfb758fdb62a330f6e5f">jsonv::to_json</a> (const T &amp;from)</td></tr>
<tr class="memdesc:ga52201f62c91cdfb758fdb62a330f6e5f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode a JSON <code>value</code> from <em>from</em> using <code><a class="el" href="classjsonv_1_1formats.html#a4403758d5e87d0862a04fc5d9171991d" title="Get the global formats instance. ">jsonv::formats::global()</a></code>.  <a href="group__Serialization.html#ga52201f62c91cdfb758fdb62a330f6e5f">More...</a><br /></td></tr>
<tr class="separator:ga52201f62c91cdfb758fdb62a330f6e5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Conversion between C++ types and JSON values. </p>
<p>Copyright (c) 2015 by Travis Gockel. All rights reserved.</p>
<p>This program is free software: you can redistribute it and/or modify it under the terms of the Apache License as published by the Apache Software Foundation, either version 2 of the License, or (at your option) any later version.</p>
<dl class="section author"><dt>Author</dt><dd>Travis Gockel (<a href="#" onclick="location.href='mai'+'lto:'+'tra'+'vi'+'s@g'+'oc'+'kel'+'hu'+'t.c'+'om'; return false;">travi<span style="display: none;">.nosp@m.</span>s@go<span style="display: none;">.nosp@m.</span>ckelh<span style="display: none;">.nosp@m.</span>ut.c<span style="display: none;">.nosp@m.</span>om</a>) </dd></dl>

<p>Definition in file <a class="el" href="serialization_8hpp_source.html">serialization.hpp</a>.</p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_10cd029e0034a3f98d221f50ebb6d9d4.html">jsonv</a></li><li class="navelem"><a class="el" href="serialization_8hpp.html">serialization.hpp</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
